package main

import "fmt"

type stu struct {
	name  string
	age   int
	score int
}

func main() {
	m := make(map[int]stu)
	m[101] = stu{"foo", 18, 99}
	m[102] = stu{"bar", 18, 99}
	fmt.Println(m)

	for k, v := range m {
		fmt.Println(k, v)
	}

	a := make(map[int][]stu)
	a[1] = append(a[1], stu{"foo", 12, 77}, stu{"bar", 13, 99})
	a[2] = append(a[2], stu{"foo1", 12, 88}, stu{"bar1", 13, 99})

	a[3] = []stu{{"a",1,3}}

	for k, v := range a {
		for i, value := range v {
			fmt.Println("k=", k, "i=", i, "value=", value)
		}
	}
}
